package thread;

public class CurrentThreadDemo {
    public static void main(String[] args) {
        //在main方法上定义下面的操作就可以获取运行main方法的线程
        Thread main = Thread.currentThread();
        System.out.println("主线程是:" + main);

    }
    public static void dosome(){
        //获取运行dosome方法的线程
        Thread t = Thread.currentThread();
        System.out.println("运行dosome方法的线城是：" + t);
    }
}
